package com.tianji.promotion.lock;

import com.tianji.promotion.lock.strategy.LockStrategyEnum;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MyLock {
    String name();
    long waitTime() default 0;
    long leaseTime() default -1;
    TimeUnit timeUnit() default TimeUnit.SECONDS;
    LockType lockType() default  LockType.LOCK;
    LockStrategyEnum lockStrategy() default  LockStrategyEnum.FAIL_FAST;

}
